from selenium import webdriver
from selenium.webdriver.common.by import By

browser = webdriver.Chrome()

url = 'https://www.baidu.com'
browser.get(url)

# button = browser.find_element(By.ID,"su")
# txt = browser.find_element(By.NAME,'wd')
# print(button)
# print(txt)

# 根据xpath语句获取元素
# txt = browser.find_element(By.XPATH, '//input[@id="kw"]')
# print(txt)
# button = browser.find_elements(By.TAG_NAME,"input")
# print(button)

# button = browser.find_element(By.CSS_SELECTOR,"#su")
# print(button)

# button = browser.find_element(By.LINK_TEXT,"新闻")
# print(button)
